﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Activation;

namespace FeCMS.AccessControlModule.ContextAccess
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
    public class PermissionValidAttribute : ContextAttribute
    {
        public PermissionValidAttribute() : base("PermissionValid") { }

        /// <summary>
        /// 将当前上下文属性添加到给定的消息。
        /// </summary>
        /// <param name="ctorMsg"></param>
        public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
        {
            //实例化一个ContextAccessPowerValidProperty 添加到上下文属性列表中
            ctorMsg.ContextProperties.Add(new PermissionProperty());
        }

    }
}
